package com.xxgc.eow.mapper;

import com.xxgc.eow.entity.Answer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 答题提交记录 Mapper 接口
 * </p>
 *
 * @author Mr.Abel
 * @since 2023-06-04
 */
@Mapper
public interface AnswerMapper extends BaseMapper<Answer> {

    Integer selectAllByUserId(Integer userId);

    Integer selectAllPassByUserId(Integer userId);

    Integer selectAllUnPassByUserId(Integer userId);

    Integer selectCountByUserIdAndLevel(@Param("userId") Integer userId,@Param("chooseLevel") Integer chooseLevel);

    Integer selectIdByUserIdAndTopicId(@Param("userId") Integer userId,@Param("topicId") Integer topicId);

    List<Answer> selectAllAnswerByUserIdAndLibraryId(@Param("userId") Integer userId,@Param("libraryId") Integer libraryId);

    Integer updateByUserId(@Param("userId") Integer userId,@Param("libraryId") Integer libraryId);
}